Fix polylineplot snapping two points at exact same time#32953
Fix polylineplot snapping two points at exact same time#32953grliszas14 wants to merge 1 commit intomusescore:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe polyline plot component's event handling was changed. The snapping function now offsets the snapped X by a small SNAP_EPSILON away from a neighbor instead of snapping exactly to the neighbor's X. Mouse press now emits a 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/framework/uicomponents/qml/Muse/UiComponents/polylineplot.cpp`:
- Around line 1364-1368: The code emits pointAdded using
m_points[m_pressedPointIndex] but only checks m_pressedPointIndex >= 0; add a
defensive upper-bound check to ensure m_pressedPointIndex < m_points.size()
before indexing. Update the mouse release / click handling branch (where
m_pressedOnLine and m_pressedPointIndex are used) to verify the index is within
range and only then read m_points and emit pointAdded (leave the existing
conditions m_pressedOnLine and isClick in place); if the index is out of range,
skip emitting to avoid out-of-bounds access.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: a44f63f9-4a9c-4f20-8664-f0f24dcf42c1
📒 Files selected for processing (1)
src/framework/uicomponents/qml/Muse/UiComponents/polylineplot.cpp
Resolves: audacity/audacity#10435